-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Create tab into Digital Twins page preview #1005
Add Create tab into Digital Twins page preview #1005
Conversation
@VanessaScherma Thanks for the PR. A very top-level review. What works:
What does not work:
What are the suggested improvements:
|
Strange. I've created two new DTs, namely "new-dt" and "new-digital-twin". But they don't show up in Manage and Execute tabs.
Ok thanks
It is alright for now. Please focus on completing the PR. |
client/src/preview/route/digitaltwins/create/CreateDTDialog.tsx
Outdated
Show resolved
Hide resolved
client/src/preview/route/digitaltwins/create/CreateDTDialog.tsx
Outdated
Show resolved
Hide resolved
client/src/preview/route/digitaltwins/editor/sidebarFunctions.ts
Outdated
Show resolved
Hide resolved
client/src/preview/route/digitaltwins/editor/sidebarFunctions.ts
Outdated
Show resolved
Hide resolved
Code Climate has analyzed commit 28c38a7 and detected 3 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VanessaScherma Thanks for the updates. Broader suggestions are:
- The Execute and Manage pages refer to default branch while the create page refers to the main branch. Please make the create page refer to the default branch as well.
- When the tab is changed, the execution status of the DTs is lost. If it is easily doable, please retain the execution status including the waiting loop icon. Otherwise, skip it for now.
- The execution fails for a newly created DT
- Suggested text for different tabs in
DigitalTwinTabDataPreview.ts
is:
Create: Create and save new digital twins. The new digital twins are saved in the linked gitlab repository. Remember to add valid `.gitlab-ci.yml` configuration as it is used for execution of digital twin.
Manage: Explore, edit and delete existing digital twins. The changes get saved in the linked gitlab repository.
Execute: Execute existing digital twins using CI/CD pipelines of the linked gitlab repository. Availability of gitlab runners is required for execution of digital twins.
In addition, please see the comments.
client/src/preview/route/digitaltwins/create/ChangeFileNameDialog.tsx
Outdated
Show resolved
Hide resolved
client/src/preview/route/digitaltwins/create/ConfirmDeleteDialog.tsx
Outdated
Show resolved
Hide resolved
client/src/preview/route/digitaltwins/editor/sidebarFunctions.tsx
Outdated
Show resolved
Hide resolved
The correct dependency graph is: DigitalTwin (create, reconfigure, execute) ---> GitlabInstance (files, commits, jobs etc)
| ^
| |
|----> Files (create, update, delete) -------------------| You can create an interface IFiles and then have both GitlabInstance and Files implement this interface. |
The current code structure requires addition of child pipeline in parent pipeline. Thus each new DT created must have an entry in top-level .gitlab-ci.yml. Otherwise, the execution of new DTs fails. The solution is to have the create step has update the |
This is how the code was refactored: The only reference to files still present in DigitalTwin are the attributes descriptionFiles, configFiles, lifecycleFiles, since they are the file names closely related to the DT. |
@prasadtalasila |
@VanessaScherma please rebase the PR |
@VanessaScherma The addition of new DT adds entries in top-level The matching lines are: The create request is adding extra tabs at the beginning of new lines. Could this be the error? |
another consequence is that the execution of existing DTs fail as well due to syntax error in top-level |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VanessaScherma Thanks for the updates. Please see the comments.
client/src/preview/util/ifile.ts
Outdated
getDescriptionFiles(): Promise<string[]>; | ||
getConfigFiles(): Promise<string[]>; | ||
getLifecycleFiles(): Promise<string[]>; | ||
appendTriggerToPipeline(): Promise<string>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move the trigger .gitlab-ci.yml
functions to DTFiles
class.
client/src/preview/util/fileUtils.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please merge this file into newly proposed DTFiles.ts
client/src/preview/util/ifile.ts
Outdated
|
||
export interface IFile { | ||
getFileContent(fileName: string, DTName: string): Promise<string>; | ||
updateFileContent(fileName: string, fileContent: string): Promise<void>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getFile()
and updateFile()
are consistent with createFile()
667b76f
to
3148f9b
Compare
@VanessaScherma Apparently the tests inside and outside of |
I made a small modification to the However, the 'Run client unit and integration tests' job fails with the |
client/test/preview/integration/components/asset/StartStopButton.test.tsx
Show resolved
Hide resolved
client/test/preview/integration/route/digitaltwins/DigitalTwinsPreview.test.tsx
Outdated
Show resolved
Hide resolved
client/test/preview/integration/route/digitaltwins/create/ChangeFileNameDialog.test.tsx
Outdated
Show resolved
Hide resolved
client/test/preview/integration/route/digitaltwins/create/ConfirmDeleteDialog.test.tsx
Outdated
Show resolved
Hide resolved
client/test/preview/integration/route/digitaltwins/create/CreatePage.test.tsx
Outdated
Show resolved
Hide resolved
client/test/preview/integration/route/digitaltwins/manage/ConfigDialog.test.tsx
Outdated
Show resolved
Hide resolved
client/test/preview/unit/routes/digitaltwins/create/CreatePage.test.tsx
Outdated
Show resolved
Hide resolved
3264921
into
INTO-CPS-Association:feature/distributed-demo
Title
Add Create tab into Digital Twins page preview
Type of Change
Description
PR with the aim of solving issue #1002.
When opening, the Create page shows the Editor and three files already placed in the sidebar:
description.md
README.md
.gitlab-ci.yml
The user can:
.gitlab-ci.yml
as it is necessary for the execution of the DT)By clicking on the ‘Create’ button, the user can enter the name of the DT, which will correspond to the name of the sub-folder within his GitLab digitaltwins folder, and confirm the operation.
At the end of the operation, the Snackbar informs of success or failure.
By switching to one of the other tabs, the DT is already visible.
Testing
Unit and integration tests are currently in progress.
Impact
These changes add a new functionality, allowing the user to insert new digital twins.
Additional Information
None.
Checklist
existing code.